#ifndef IMAGEIOWIZARD_H
#define IMAGEIOWIZARD_H

#include "GuidedNativeImageIO.h"

#include <QWizard>
#include <QString>
#include <QStringList>
#include <QDir>

QT_BEGIN_NAMESPACE
class QCheckBox;
class QGroupBox;
class QLabel;
class QLineEdit;
class QRadioButton;
QT_END_NAMESPACE

class ImageIOWizard : public QWizard
{
    Q_OBJECT

public:
    enum { Page_File, Page_DICOM, Page_ACT, PageROI_ACT };

    ImageIOWizard(QWidget *parent = 0);
    ~ImageIOWizard();

    GuidedNativeImageIO& GetImageIO()
    { return *m_GuidedIO; }

    void ReleaseImage()
    { m_GuidedIO->DeallocateImage(); }

    bool IsImageLoaded()
    { return m_GuidedIO->IsImageLoaded(); }
  
private:
    GuidedNativeImageIO *m_GuidedIO;  
};

namespace Ui{
  class HeaderPage;
  class FilePage;
  class ACTHeaderPage;
  class ACT_ROIPage;
}

class FilePage : public QWizardPage
{
    Q_OBJECT

public:
    typedef GuidedNativeImageIO::FileFormat FileFormat;

    FilePage(GuidedNativeImageIO *guidedIO, QWidget *parent = 0);
    ~FilePage() {}

private:
    int nextId() const;

    Ui::FilePage *ui;
    GuidedNativeImageIO *m_FPGuidedIO;

    FileFormat m_FileFormat;
  
private slots:
    void BrowsePushed();
};

class HeaderPage : public QWizardPage
{
    Q_OBJECT

public:

    HeaderPage(GuidedNativeImageIO *guidedIO, QWidget *parent = 0);
    ~HeaderPage() {}

private:
    int nextId() const
    { return -1; }

    Ui::HeaderPage *ui;
    GuidedNativeImageIO *m_HPGuidedIO;
    ImageProperties *m_ImageProperties;
  
private slots:
    void initializePage();
};

class ACTHeaderPage : public QWizardPage
{
    Q_OBJECT

public:
    ACTHeaderPage(GuidedNativeImageIO *guidedIO, QWidget *parent = 0);
    ~ACTHeaderPage() {}

private:
    int nextId() const;

    Ui::ACTHeaderPage *ui;
    GuidedNativeImageIO *m_ACTHPGuidedIO;
    ImageProperties *m_ImageProperties;

private slots:
    void initializePage();
};

class ACT_ROIPage : public QWizardPage
{
    Q_OBJECT

public:
    ACT_ROIPage(GuidedNativeImageIO *guidedIO, QWidget *parent = 0);
    ~ACT_ROIPage() {}

private:
    int nextId() const
    { return -1; }

    Ui::ACT_ROIPage *ui;
    GuidedNativeImageIO *m_ACTROIGuidedIO;
    ImageProperties *m_ImageProperties;

private slots:
    void BrowsePushed();
    void initializePage() {}
};

#endif
